function CE.Warlock(arg1, goat2)
--arg1 = "v1" or "v2" for debugging
--goat2: "0" = Buffs, "1" = Melee, "2" = Ranged or instant , 3 = Food and potions,
--goat2: "4" = Boss Burst buffs, "pvp" = PvP combo, "aoe" = aoe skils
    local Skill = {}
    local Skill2 = {}
    local i = 0
    
    -- Player and target status.
    local combat = GetPlayerCombatState()
    local enemy = UnitCanAttack("player","target")
	local phealth = PctH("player")
    local thealth = PctH("target")
	local playerHP = (UnitHealth("player"))
	local targetHP = UnitHealth("target")
	local pctEB1 = PctM("player")
	local pctEB2 = PctS("player")
    local EnergyBar1 = UnitMana("player")
	local EnergyBar2 = UnitSkill("player")
    local tbuffs = BuffList("target")
    local pbuffs = BuffList("player")
    local tDead = UnitIsDeadOrGhost("target")
    --local behind = (not UnitIsUnit("player", "targettarget"))
	--local behind1 = IsUsableAction(9) -- # is your blind spot spell slot number
	--local melee = GetActionUsable(45) -- # is your melee range spell slot number
	--local a1,a2,a3,a4,a5,ASon = GetActionInfo(4)  -- # is your Autoshot slot number
	local PsiPoints, PsiStatus = GetSoulPoint()
	local ammo = (GetEquipSlotInfo(10) ~= nil)
	local zoneid = (GetZoneID() % 1000)
    local SeigeWar = (zoneid == 402) -- The "Seige War" Zone
    local boss = UnitSex("target") >= 3
    local elite = UnitSex("target") == 2
    local party = GetNumPartyMembers() >= 2
	local PetExists = UnitExists("playerpet") 
	local MobName = UnitName("target")
	local bowslot = GetEquipSlotInfo(11) == "interface\\CharacterFrame\\Equipment-RangedSlot" -- check if you have bow equiped
	
	-- Food And pot Dropdown menu locales
	local Rebuff = tonumber(CE_Settings[CE.playerName]["Tab3"]["Rebuff"])
	local HpDef = tonumber(CE_Settings[CE.playerName]["Tab3"]["HpDef"])
	local HpDef_Use = (not pbuffs[CE.BuffCheck("HpDef")] or pbuffs[CE.BuffCheck("HpDef")].time <= Rebuff)
	local HpDef_Check = CE_Settings[CE.playerName]["Tab3"]["HpDef_Check"]
	local DmgFood = tonumber(CE_Settings[CE.playerName]["Tab3"]["DmgFood"])
	local DmgFood_Use = (not pbuffs[CE.BuffCheck("DmgFood")] or pbuffs[CE.BuffCheck("DmgFood")].time <= Rebuff)
	local DmgFood_Check = CE_Settings[CE.playerName]["Tab3"]["DmgFood_Check"]
	local SpeedPot = tonumber(CE_Settings[CE.playerName]["Tab3"]["SpeedPot"])
	local SpeedPot_Use = not pbuffs[CE.BuffCheck("SpeedPot")]
	local SpeedPot_Check = CE_Settings[CE.playerName]["Tab3"]["SpeedPot_Check"]
	local CritFood = tonumber(CE_Settings[CE.playerName]["Tab3"]["CritFood"])
	local CritFood_Use = not pbuffs[CE.BuffCheck("CritFood")]
	local CritFood_Check = CE_Settings[CE.playerName]["Tab3"]["CritFood_Check"]
	local CritPot = tonumber(CE_Settings[CE.playerName]["Tab3"]["CritPot"])
	local CritPot_Use = not pbuffs[CE.BuffCheck("CritPot")]
	local CritPot_Check = CE_Settings[CE.playerName]["Tab3"]["CritPot_Check"]
	local Sigil = tonumber(CE_Settings[CE.playerName]["Tab3"]["Sigil"])
	local Sigil_Use = not pbuffs[CE.BuffCheck("Sigil")]
	local Sigil_Check = CE_Settings[CE.playerName]["Tab3"]["Sigil_Check"]
	local ISFood =  tonumber(CE_Settings[CE.playerName]["Tab3"]["ItemShop"])
	local ISFood_Use = (not pbuffs[CE.BuffCheck("ItemShop")] or pbuffs[CE.BuffCheck("ItemShop")].time <= Rebuff)
	local ISFood_Check = CE_Settings[CE.playerName]["Tab3"]["ItemShop_Check"]
	local Realgar = CE_Settings[CE.playerName]["BurstSlim"]["Realgar"]
	local Realgar_Use = (not pbuffs[501616] or pbuffs[501616].time <= Rebuff)
	local Hero = CE_Settings[CE.playerName]["BurstSlim"]["Hero_Pot"]
	local Hero_Use = (not pbuffs[501337] or pbuffs[501337].time <= Rebuff)
	local LongBuff = CE_Settings[CE.playerName]["BurstSlim"]["5MinBuff"]
	
    --Silence, Substitute and Protect Logic
	local silenceList = CE.silenceList
	local protectList = CE.protectList
	local subList = CE.subList
    local tSpell,tTime,tElapsed = UnitCastingTime("target")
    local silenceThis = tSpell and silenceList[tSpell] and ((tTime - tElapsed) > 0.1)
    local protect = tSpell and protectList[tSpell] and ((tTime - tElapsed) > 0.1)
    local subThis = tSpell and subList[tSpell] and ((tTime - tElapsed) > 0.1)
	
	--Determine Class-Combo
    mainClass, subClass = UnitClassToken( "player" )
	
    --Begin Player Skill Sequences
        --Rogue = THIEF, Scout = RANGER, Mage = MAGE, Knight = KNIGHT, 
        --Druid = DRUID, Priest = AUGUR, Warden = WARDEN, Warrior = WARRIOR
		--Champion = PSYRON, Warlock = HARPSYN
	if mainClass == "HARPSYN" then
		-------------------
		-- WARLOCK/ROGUE -- 1/11/2013
		-------------------
		if subClass == "THIEF" then
			if (goat2 == "0") then	-- Long bufs
				Skill =  {
					{ name = "ID: 498914",			use = (not pbuffs[621736]) },						-- Sublimation Weave Curse
					{ name = "ItemID: 207200",		use = not pbuffs[506684] and CE.HaveItem(207200) },	-- Unbridled Enthusiasm
					{ name = "ItemID: 207202", 		use = not pbuffs[506686] and CE.HaveItem(207202) },	-- Clear Thought
					{ name = "ItemID: 207203",		use = not pbuffs[506687] and CE.HaveItem(207203) },	-- Lucky Target
					{ name = "ItemID: 207206", 		use = not pbuffs[506690] and CE.HaveItem(207206) },	-- Scarlet Love
						}
			elseif goat2 == "3" then -- Burst boss buff's
				Skill = {
					{ name = "Func: CE.Item("..Sigil..")",	use = Sigil_Use and CE.HaveItem(Sigil) and Sigil_Check and CE.ItemCD(Sigil)},	-- Sigil
					{ name = "ItemID: "..CritFood,	use = CritFood_Use and CE.HaveItem(CritFood) and CritFood_Check and CE.ItemCD(CritFood)},	-- Critical hit food
					{ name = "ItemID: "..SpeedPot,	use = SpeedPot_Use and CE.HaveItem(SpeedPot) and SpeedPot_Check and CE.ItemCD(SpeedPot)},	-- Cast or Attack speed pot
					{ name = "ItemID: "..CritPot,	use = CritPot_Use and CE.HaveItem(CritPot) and CritPot_Check and CE.ItemCD(CritPot) },		-- Critical hit pot
						}
			elseif goat2 == "4" then -- Food and potions
				Skill = {
					{ name = "ItemID: "..HpDef,			use = HpDef_Use and CE.HaveItem(HpDef) and HpDef_Check and CE.ItemCD(HpDef) },			-- Hp or Defense food
					{ name = "ItemID: "..DmgFood, 		use = DmgFood_Use and CE.HaveItem(DmgFood) and DmgFood_Check and CE.ItemCD(DmgFood) },	-- Attack or damage food
					{ name = "ItemID: 200277",			use = Hero_Use and CE.HaveItem(200277) and Hero and CE.ItemCD(200277) },		-- Hero potion
					{ name = "ItemID: 202242",			use = Realgar_Use and CE.HaveItem(202242) and Realgar and CE.ItemCD(202242) },	-- Aged Realgar Wine
					{ name = "Func: CE.ISFood()",		use = ISFood_Use and CE.HaveItem(ISFood) and ISFood_Check and CE.ItemCD(ISFood) },	-- ItemShop Hp/Def Food
						}
			end
				
			if ((enemy) and (goat2 == "1")) then -- Main DPS Rotation
				Skill2 = {
					{ name = "ID: 498553",	use = (tbuffs[501577]) and (EnergyBar1 >= 20) },		-- Puzzelment
					{ name = "ID: 498545",	use = (EnergyBar1 <= 49) },								-- Heart Colection Strike
					{ name = "ID: 498670",	use = (not tbuffs[621399]) and (EnergyBar2 >= 25) },	-- Soul Poisoned Fang
					{ name = "ID: 499865",	use = (not tbuffs[621401]) and (EnergyBar2 >= 20) },	-- Shadowstab
					{ name = "ID: 497958",	use = (not pbuffs[501575]) and (EnergyBar1 >= 30) },	-- Warp Charge
					{ name = "ID: 497960",	use = (not pbuffs[621655]) and (EnergyBar1 <= 40)},		-- Perception Extraction
					{ name = "ID: 497959",	use = (not pbuffs[501577]) and (EnergyBar1 >= 20)},		-- Weakening Weave Curse
						}
			elseif ((enemy) and (goat2 == "2")) then -- instant skilovi
				Skill2 = {
					{ name = "Willpower Blade",          			use = ((not pbuffs[501571]) and (PsiPoints == 6)) },
					{ name = "Ruthless Judgment",          			use = ((pbuffs[501571]) and (PsiPoints >= 2) and (0.2 > thealth) and (not pbuffs["Ruthless Judgment"])) },
					{ name = "Knowledge Acquisition",          		use = ((pbuffs[501571]) and (PsiPoints >= 4) and (not pbuffs[621451])) },
					{ name = "Psychic Arrows",   					use = ((EnergyBar1 >= 20) and (not pbuffs[501571]) and (PsiPoints == 0)) },
					{ name = "Flaming Heart Strike",          		use = (PsiPoints > 0) },
					{ name = "Puzzlement",          				use = ((tbuffs["Weakened"]) and (EnergyBar1 >= 20) and (PsiPoints > 0)) },
					{ name = "Soul Brand Sting",          			use = (((pbuffs[501571]) and (PsiPoints >= 1)) or ((PsiPoints == 1) and (pbuffs[501571]))) },
					{ name = "Severed Consciousness",          		use = ((pbuffs[501571]) and (PsiPoints >= 2)) },
					{ name = "Warp Charge",                      	use = ((not pbuffs["Warp Charge"]) and (EnergyBar1 >= 30)) },
					{ name = "Psychic Arrows",   					use = ((EnergyBar1 >= 20) and (not pbuffs[501571])) },
					{ name = "Surge of Malice",          			use = ((tbuffs["Weakened"]) and (EnergyBar1 >= 20)) },
					{ name = "Fireball",   							use = (true) },
					{ name = "Heart Collection Strike",          	use = (tbuffs["Weakened"]) },
					{ name = "Weakening Weave Curse",          		use = ((not tbuffs["Weakened"]) and (EnergyBar1 >= 20)) },
					{ name = "Perception Extraction",               use = ((not pbuffs["Perception Extraction"])) },
						}
			elseif ((enemy) and (goat2 == "pvp")) then -- PVP testing
				Skill2 = {
					{ name = "Willpower Blade",          			use = ((not pbuffs[501571]) and (PsiPoints == 6)) },
					{ name = "Ruthless Judgment",          			use = ((pbuffs[501571]) and (PsiPoints >= 2) and (0.2 > thealth) and (not pbuffs["Ruthless Judgment"])) },
					{ name = "Knowledge Acquisition",          		use = ((pbuffs[501571]) and (PsiPoints >= 4) and (not pbuffs[621451])) },
					{ name = "Psychic Arrows",   					use = ((EnergyBar1 >= 20) and (not pbuffs[501571]) and (PsiPoints == 0)) },
					{ name = "Flaming Heart Strike",          		use = (PsiPoints > 0) },
					{ name = "Puzzlement",          				use = ((tbuffs["Weakened"]) and (EnergyBar1 >= 20) and (PsiPoints > 0)) },
					{ name = "Soul Brand Sting",          			use = (((pbuffs[501571]) and (PsiPoints >= 1)) or ((PsiPoints == 1) and (pbuffs[501571]))) },
					{ name = "Severed Consciousness",          		use = ((pbuffs[501571]) and (PsiPoints >= 2)) },
					{ name = "Warp Charge",                      	use = ((not pbuffs["Warp Charge"]) and (EnergyBar1 >= 30)) },
					{ name = "Psychic Arrows",   					use = ((EnergyBar1 >= 20) and (not pbuffs[501571])) },
					{ name = "Surge of Malice",          			use = ((tbuffs["Weakened"]) and (EnergyBar1 >= 20)) },
					{ name = "Fireball",   							use = (true) },
					{ name = "Heart Collection Strike",          	use = (tbuffs["Weakened"]) },
					{ name = "Weakening Weave Curse",          		use = ((not tbuffs["Weakened"]) and (EnergyBar1 >= 20)) },
					{ name = "Perception Extraction",               use = ((not pbuffs["Perception Extraction"])) },
						}
			end
		-------------------
		-- WARLOCK/SCOUT --
		-------------------
		elseif subClass == "RANGER" then
			if (goat2 == "0") then -- Long bufs
				Skill = {{ name = "Func: CE.NoCode()",	use = (true) }}
			elseif goat2 == "3" then -- Burst boss buff's
				Skill = {
					{ name = "Func: CE.Item("..Sigil..")",	use = Sigil_Use and CE.HaveItem(Sigil) and Sigil_Check and CE.ItemCD(Sigil)},	-- Sigil
					{ name = "ItemID: "..CritFood,	use = CritFood_Use and CE.HaveItem(CritFood) and CritFood_Check and CE.ItemCD(CritFood)},	-- Critical hit food
					{ name = "ItemID: "..SpeedPot,	use = SpeedPot_Use and CE.HaveItem(SpeedPot) and SpeedPot_Check and CE.ItemCD(SpeedPot)},	-- Cast or Attack speed pot
					{ name = "ItemID: "..CritPot,	use = CritPot_Use and CE.HaveItem(CritPot) and CritPot_Check and CE.ItemCD(CritPot) },		-- Critical hit pot
						}
			elseif goat2 == "4" then -- Food and potions
				Skill = {
					{ name = "ItemID: "..HpDef,			use = HpDef_Use and CE.HaveItem(HpDef) and HpDef_Check and CE.ItemCD(HpDef) },			-- Hp or Defense food
					{ name = "ItemID: "..DmgFood, 		use = DmgFood_Use and CE.HaveItem(DmgFood) and DmgFood_Check and CE.ItemCD(DmgFood) },	-- Attack or damage food
					{ name = "ItemID: 200277",			use = Hero_Use and CE.HaveItem(200277) and Hero and CE.ItemCD(200277) },		-- Hero potion
					{ name = "ItemID: 202242",			use = Realgar_Use and CE.HaveItem(202242) and Realgar and CE.ItemCD(202242) },	-- Aged Realgar Wine
					{ name = "Func: CE.ISFood()",		use = ISFood_Use and CE.HaveItem(ISFood) and ISFood_Check and CE.ItemCD(ISFood) },	-- ItemShop Hp/Def Food
						}
			end
			
			if ((enemy) and (goat2 == "1")) then -- Main DPS combo
				Skill2 = {{ name = "Func: CE.NoCode()",	use = (true) }}
			elseif ((enemy) and (goat2 == "2")) then -- Ranged or instant skils combo
				Skill2 = {{ name = "Func: CE.NoCode()",	use = (true) }}
			elseif ((enemy) and (goat2 == "pvp")) then -- PVP combo
				Skill2 = {{ name = "Func: CE.NoCode()",	use = (true) }}
			end
		------------------
		-- WARLOCK/MAGE --
		------------------
		elseif subClass == "MAGE" then
			if (goat2 == "0") then
				Skill =  {
					{ name = "Focus Building",             			use = (not pbuffs[621444]) },
					{ name = "Sublimation Weave Curse",             use = (not pbuffs["Sublimation Weave Curse"]) },
					{ name = "Fire Ward",             				use = ((not pbuffs[621397]) or (not pbuffs[500366])) },
					{ name = "ItemID: 207202", 		use = not pbuffs[506686] and CE.HaveItem(207202) and CE.ItemCD(207202) },	-- Clear Thought
					{ name = "ItemID: 207203",		use = not pbuffs[506687] and CE.HaveItem(207203) and CE.ItemCD(207203) },	-- Lucky Target
					{ name = "Item: Potion: Unbridled Enthusiasm", 	use = ((not pbuffs["Unbridled Enthusiasm"]) and CE.HaveItem(207200)) },
					{ name = "ItemID: 207206", 		use = not pbuffs[506690] and CE.HaveItem(207206) and CE.ItemCD(207206) },	-- Scarlet Love
						  }
			elseif goat2 == "3" then -- Burst boss buff's
				Skill = {
					{ name = "Func: CE.Item("..Sigil..")",	use = Sigil_Use and CE.HaveItem(Sigil) and Sigil_Check and CE.ItemCD(Sigil)},	-- Sigil
					{ name = "ItemID: "..CritFood,	use = CritFood_Use and CE.HaveItem(CritFood) and CritFood_Check and CE.ItemCD(CritFood)},	-- Critical hit food
					{ name = "ItemID: "..SpeedPot,	use = SpeedPot_Use and CE.HaveItem(SpeedPot) and SpeedPot_Check and CE.ItemCD(SpeedPot)},	-- Cast or Attack speed pot
					{ name = "ItemID: "..CritPot,	use = CritPot_Use and CE.HaveItem(CritPot) and CritPot_Check and CE.ItemCD(CritPot) },		-- Critical hit pot
					{ name = "Thinking Overload",             		use = (not pbuffs[621451]) }, 						-- 60 sec
					{ name = "Intensification",             		use = (not pbuffs["Intensification"]) }, 			-- 20 sec	
						}
			elseif goat2 == "4" then -- Food and potions
				Skill = {
					{ name = "ItemID: "..HpDef,			use = HpDef_Use and CE.HaveItem(HpDef) and HpDef_Check and CE.ItemCD(HpDef) },			-- Hp or Defense food
					{ name = "ItemID: "..DmgFood, 		use = DmgFood_Use and CE.HaveItem(DmgFood) and DmgFood_Check and CE.ItemCD(DmgFood) },	-- Attack or damage food
					{ name = "ItemID: 200277",			use = Hero_Use and CE.HaveItem(200277) and Hero and CE.ItemCD(200277) },		-- Hero potion
					{ name = "ItemID: 202242",			use = Realgar_Use and CE.HaveItem(202242) and Realgar and CE.ItemCD(202242) },	-- Aged Realgar Wine
					{ name = "Func: CE.ISFood()",		use = ISFood_Use and CE.HaveItem(ISFood) and ISFood_Check and CE.ItemCD(ISFood) },	-- ItemShop Hp/Def Food
						}
			end
				
			if ((enemy) and (goat2 == "1")) then -- Main Dps Combo
				Skill2 = {
					{ name = "Willpower Blade",          			use = ((not pbuffs[501571]) and (PsiPoints == 6)) },
					{ name = "Ruthless Judgment",          			use = ((pbuffs[501571]) and (PsiPoints >= 2) and (0.2 > thealth) and (not pbuffs["Ruthless Judgment"])) },
					{ name = "Knowledge Acquisition",          		use = ((pbuffs[501571]) and (PsiPoints >= 4) and (not pbuffs[621451])) },
					{ name = "Psychic Arrows",   					use = ((EnergyBar1 >= 20) and (not pbuffs[501571]) and (PsiPoints == 0)) },
					{ name = "Flaming Heart Strike",          		use = (PsiPoints > 0) },
					{ name = "Puzzlement",          				use = ((tbuffs["Weakened"]) and (EnergyBar1 >= 20) and (PsiPoints > 0)) },
					{ name = "Soul Brand Sting",          			use = (((pbuffs[501571]) and (PsiPoints >= 1)) or ((PsiPoints == 1) and (pbuffs[501571]))) },
					{ name = "Severed Consciousness",          		use = ((pbuffs[501571]) and (PsiPoints >= 2)) },
					{ name = "Warp Charge",                      	use = ((not pbuffs["Warp Charge"]) and (EnergyBar1 >= 30)) },
					{ name = "Psychic Arrows",   					use = ((EnergyBar1 >= 20) and (not pbuffs[501571])) },
					{ name = "Surge of Malice",          			use = ((tbuffs["Weakened"]) and (EnergyBar1 >= 20)) },
					{ name = "Fireball",   							use = (true) },
					{ name = "Heart Collection Strike",          	use = (tbuffs["Weakened"]) },
					{ name = "Weakening Weave Curse",          		use = ((not tbuffs["Weakened"]) and (EnergyBar1 >= 20)) },
					{ name = "Perception Extraction",               use = ((not pbuffs["Perception Extraction"])) },
						}
			elseif ((enemy) and (goat2 == "2")) then -- Ranged or instant skils combo
				Skill2 = {{ name = "Func: CE.NoCode()",	use = (true) }}
			elseif ((enemy) and (goat2 == "pvp")) then -- PVP testing
				Skill2 = {
					{ name = "Willpower Blade",          			use = ((not pbuffs[501571]) and (PsiPoints == 6)) },
					{ name = "Ruthless Judgment",          			use = ((pbuffs[501571]) and (PsiPoints >= 2) and (0.2 > thealth) and (not pbuffs["Ruthless Judgment"])) },
					{ name = "Knowledge Acquisition",          		use = ((pbuffs[501571]) and (PsiPoints >= 4) and (not pbuffs[621451])) },
					{ name = "Psychic Arrows",   					use = ((EnergyBar1 >= 20) and (not pbuffs[501571]) and (PsiPoints == 0)) },
					{ name = "Flaming Heart Strike",          		use = (PsiPoints > 0) },
					{ name = "Puzzlement",          				use = ((tbuffs["Weakened"]) and (EnergyBar1 >= 20) and (PsiPoints > 0)) },
					{ name = "Soul Brand Sting",          			use = (((pbuffs[501571]) and (PsiPoints >= 1)) or ((PsiPoints == 1) and (pbuffs[501571]))) },
					{ name = "Severed Consciousness",          		use = ((pbuffs[501571]) and (PsiPoints >= 2)) },
					{ name = "Warp Charge",                      	use = ((not pbuffs["Warp Charge"]) and (EnergyBar1 >= 30)) },
					{ name = "Psychic Arrows",   					use = ((EnergyBar1 >= 20) and (not pbuffs[501571])) },
					{ name = "Surge of Malice",          			use = ((tbuffs["Weakened"]) and (EnergyBar1 >= 20)) },
					{ name = "Fireball",   							use = (true) },
					{ name = "Heart Collection Strike",          	use = (tbuffs["Weakened"]) },
					{ name = "Weakening Weave Curse",          		use = ((not tbuffs["Weakened"]) and (EnergyBar1 >= 20)) },
					{ name = "Perception Extraction",               use = ((not pbuffs["Perception Extraction"])) },
						}
			end
		--------------------
		-- WARLOCK/KNIGHT --
		--------------------
		elseif subClass == "KNIGHT" then
			if (goat2 == "0") then -- Long bufs
				Skill = {{ name = "Func: CE.NoCode()",	use = (true) }}
			elseif goat2 == "3" then -- Burst boss buff's
				Skill = {
					{ name = "Func: CE.Item("..Sigil..")",	use = Sigil_Use and CE.HaveItem(Sigil) and Sigil_Check and CE.ItemCD(Sigil)},	-- Sigil
					{ name = "ItemID: "..CritFood,	use = CritFood_Use and CE.HaveItem(CritFood) and CritFood_Check and CE.ItemCD(CritFood)},	-- Critical hit food
					{ name = "ItemID: "..SpeedPot,	use = SpeedPot_Use and CE.HaveItem(SpeedPot) and SpeedPot_Check and CE.ItemCD(SpeedPot)},	-- Cast or Attack speed pot
					{ name = "ItemID: "..CritPot,	use = CritPot_Use and CE.HaveItem(CritPot) and CritPot_Check and CE.ItemCD(CritPot) },		-- Critical hit pot
						}
			elseif goat2 == "4" then -- Food and potions
				Skill = {
					{ name = "ItemID: "..HpDef,			use = HpDef_Use and CE.HaveItem(HpDef) and HpDef_Check and CE.ItemCD(HpDef) },			-- Hp or Defense food
					{ name = "ItemID: "..DmgFood, 		use = DmgFood_Use and CE.HaveItem(DmgFood) and DmgFood_Check and CE.ItemCD(DmgFood) },	-- Attack or damage food
					{ name = "ItemID: 200277",			use = Hero_Use and CE.HaveItem(200277) and Hero and CE.ItemCD(200277) },		-- Hero potion
					{ name = "ItemID: 202242",			use = Realgar_Use and CE.HaveItem(202242) and Realgar and CE.ItemCD(202242) },	-- Aged Realgar Wine
					{ name = "Func: CE.ISFood()",		use = ISFood_Use and CE.HaveItem(ISFood) and ISFood_Check and CE.ItemCD(ISFood) },	-- ItemShop Hp/Def Food
						}
			end
			
			if ((enemy) and (goat2 == "1")) then -- Main DPS combo
				Skill2 = {{ name = "Func: CE.NoCode()",	use = (true) }}
			elseif ((enemy) and (goat2 == "2")) then -- Ranged or instant skils combo
				Skill2 = {{ name = "Func: CE.NoCode()",	use = (true) }}
			elseif ((enemy) and (goat2 == "pvp")) then -- PVP combo
				Skill2 = {{ name = "Func: CE.NoCode()",	use = (true) }}
			end
		-------------------
		-- WARLOCK/DRUID --
		-------------------
		elseif subClass == "DRUID" then
			if (goat2 == "0") then -- Long bufs
				Skill = {{ name = "Func: CE.NoCode()",	use = (true) }}
			elseif goat2 == "3" then -- Burst boss buff's
				Skill = {
					{ name = "Func: CE.Item("..Sigil..")",	use = Sigil_Use and CE.HaveItem(Sigil) and Sigil_Check and CE.ItemCD(Sigil)},	-- Sigil
					{ name = "ItemID: "..CritFood,	use = CritFood_Use and CE.HaveItem(CritFood) and CritFood_Check and CE.ItemCD(CritFood)},	-- Critical hit food
					{ name = "ItemID: "..SpeedPot,	use = SpeedPot_Use and CE.HaveItem(SpeedPot) and SpeedPot_Check and CE.ItemCD(SpeedPot)},	-- Cast or Attack speed pot
					{ name = "ItemID: "..CritPot,	use = CritPot_Use and CE.HaveItem(CritPot) and CritPot_Check and CE.ItemCD(CritPot) },		-- Critical hit pot
						}
			elseif goat2 == "4" then -- Food and potions
				Skill = {
					{ name = "ItemID: "..HpDef,			use = HpDef_Use and CE.HaveItem(HpDef) and HpDef_Check and CE.ItemCD(HpDef) },			-- Hp or Defense food
					{ name = "ItemID: "..DmgFood, 		use = DmgFood_Use and CE.HaveItem(DmgFood) and DmgFood_Check and CE.ItemCD(DmgFood) },	-- Attack or damage food
					{ name = "ItemID: 200277",			use = Hero_Use and CE.HaveItem(200277) and Hero and CE.ItemCD(200277) },		-- Hero potion
					{ name = "ItemID: 202242",			use = Realgar_Use and CE.HaveItem(202242) and Realgar and CE.ItemCD(202242) },	-- Aged Realgar Wine
					{ name = "Func: CE.ISFood()",		use = ISFood_Use and CE.HaveItem(ISFood) and ISFood_Check and CE.ItemCD(ISFood) },	-- ItemShop Hp/Def Food
						}
			end
			
			if ((enemy) and (goat2 == "1")) then -- Main DPS combo
				Skill2 = {{ name = "Func: CE.NoCode()",	use = (true) }}
			elseif ((enemy) and (goat2 == "2")) then -- Ranged or instant skils combo
				Skill2 = {{ name = "Func: CE.NoCode()",	use = (true) }}
			elseif ((enemy) and (goat2 == "pvp")) then -- PVP combo
				Skill2 = {{ name = "Func: CE.NoCode()",	use = (true) }}
			end
		--------------------
		-- WARLOCK/PRIEST --
		--------------------
		elseif subClass == "AUGUR" then
			if (goat2 == "0") then
				Skill =  {
					{ name = "Sublimation Weave Curse",             use = (not pbuffs["Sublimation Weave Curse"]) },
					{ name = "Magic Barrier",             			use = (not pbuffs["Magic Barrier"]) },
					{ name = "Blessed Spring Water",             	use = (not pbuffs["Blessed Spring Water"]) },
					{ name = "ItemID: 207202", 		use = not pbuffs[506686] and CE.HaveItem(207202) and CE.ItemCD(207202) },	-- Clear Thought
					{ name = "ItemID: 207203",		use = not pbuffs[506687] and CE.HaveItem(207203) and CE.ItemCD(207203) },	-- Lucky Target
					{ name = "Item: Potion: Unbridled Enthusiasm", 	use = ((not pbuffs["Unbridled Enthusiasm"]) and CE.HaveItem(207200)) },
					{ name = "ItemID: 207206", 		use = not pbuffs[506690] and CE.HaveItem(207206) and CE.ItemCD(207206) },	-- Scarlet Love
						  }
			elseif goat2 == "3" then -- Burst boss buff's
				Skill = {
					{ name = "Func: CE.Item("..Sigil..")",	use = Sigil_Use and CE.HaveItem(Sigil) and Sigil_Check and CE.ItemCD(Sigil)},	-- Sigil
					{ name = "ItemID: "..CritFood,	use = CritFood_Use and CE.HaveItem(CritFood) and CritFood_Check and CE.ItemCD(CritFood)},	-- Critical hit food
					{ name = "ItemID: "..SpeedPot,	use = SpeedPot_Use and CE.HaveItem(SpeedPot) and SpeedPot_Check and CE.ItemCD(SpeedPot)},	-- Cast or Attack speed pot
					{ name = "ItemID: "..CritPot,	use = CritPot_Use and CE.HaveItem(CritPot) and CritPot_Check and CE.ItemCD(CritPot) },		-- Critical hit pot
						}
			elseif goat2 == "4" then -- Food and potions
				Skill = {
					{ name = "ItemID: "..HpDef,			use = HpDef_Use and CE.HaveItem(HpDef) and HpDef_Check and CE.ItemCD(HpDef) },			-- Hp or Defense food
					{ name = "ItemID: "..DmgFood, 		use = DmgFood_Use and CE.HaveItem(DmgFood) and DmgFood_Check and CE.ItemCD(DmgFood) },	-- Attack or damage food
					{ name = "ItemID: 200277",			use = Hero_Use and CE.HaveItem(200277) and Hero and CE.ItemCD(200277) },		-- Hero potion
					{ name = "ItemID: 202242",			use = Realgar_Use and CE.HaveItem(202242) and Realgar and CE.ItemCD(202242) },	-- Aged Realgar Wine
					{ name = "Func: CE.ISFood()",		use = ISFood_Use and CE.HaveItem(ISFood) and ISFood_Check and CE.ItemCD(ISFood) },	-- ItemShop Hp/Def Food
						}
			end
				
			if ((enemy) and (goat2 == "1")) then -- instant skilovi
				Skill2 = {
					{ name = "Regenerate",             				use = ((not pbuffs["Regenerate"]) and (phealth < 0.80)) },
					{ name = "Urgent Heal",             			use = (((pbuffs["Healing Fortune"]) and (phealth < 0.75)) or (phealth < 0.50)) },
					{ name = "Surge of Malice",          			use = ((tbuffs["Weakened"]) and (EnergyBar1 >= 20)) },
					{ name = "Heart Collection Strike",          	use = (tbuffs["Weakened"]) },
					{ name = "Puzzlement",          				use = ((tbuffs["Weakened"]) and (EnergyBar1 >= 20)) },
					{ name = "Weakening Weave Curse",          		use = ((not tbuffs["Weakened"]) and (EnergyBar1 >= 20)) },
					{ name = "Rising Tide",   						use = (true) },
					{ name = "Warp Charge",                      	use = ((not pbuffs["Warp Charge"]) and (EnergyBar1 >= 30)) },
					{ name = "Perception Extraction",               use = ((not pbuffs["Perception Extraction"])) },
					{ name = "Psychic Arrows",   					use = (EnergyBar1 >= 20) },
						}
			elseif ((enemy) and (goat2 == "2")) then -- Ranged or instant skils combo
				Skill2 = {{ name = "Func: CE.NoCode()",	use = (true) }}
			elseif ((enemy) and (goat2 == "pvp")) then -- PVP combo
				Skill2 = {{ name = "Func: CE.NoCode()",	use = (true) }}
			end
		--------------------
		-- WARLOCK/WARDEN --
		--------------------
		elseif subClass == "WARDEN" then
			if (goat2 == "0") then -- Long bufs
				Skill = {{ name = "Func: CE.NoCode()",	use = (true) }}
			elseif goat2 == "3" then -- Burst boss buff's
				Skill = {
					{ name = "Func: CE.Item("..Sigil..")",	use = Sigil_Use and CE.HaveItem(Sigil) and Sigil_Check and CE.ItemCD(Sigil)},	-- Sigil
					{ name = "ItemID: "..CritFood,	use = CritFood_Use and CE.HaveItem(CritFood) and CritFood_Check and CE.ItemCD(CritFood)},	-- Critical hit food
					{ name = "ItemID: "..SpeedPot,	use = SpeedPot_Use and CE.HaveItem(SpeedPot) and SpeedPot_Check and CE.ItemCD(SpeedPot)},	-- Cast or Attack speed pot
					{ name = "ItemID: "..CritPot,	use = CritPot_Use and CE.HaveItem(CritPot) and CritPot_Check and CE.ItemCD(CritPot) },		-- Critical hit pot
						}
			elseif goat2 == "4" then -- Food and potions
				Skill = {
					{ name = "ItemID: "..HpDef,			use = HpDef_Use and CE.HaveItem(HpDef) and HpDef_Check and CE.ItemCD(HpDef) },			-- Hp or Defense food
					{ name = "ItemID: "..DmgFood, 		use = DmgFood_Use and CE.HaveItem(DmgFood) and DmgFood_Check and CE.ItemCD(DmgFood) },	-- Attack or damage food
					{ name = "ItemID: 200277",			use = Hero_Use and CE.HaveItem(200277) and Hero and CE.ItemCD(200277) },		-- Hero potion
					{ name = "ItemID: 202242",			use = Realgar_Use and CE.HaveItem(202242) and Realgar and CE.ItemCD(202242) },	-- Aged Realgar Wine
					{ name = "Func: CE.ISFood()",		use = ISFood_Use and CE.HaveItem(ISFood) and ISFood_Check and CE.ItemCD(ISFood) },	-- ItemShop Hp/Def Food
						}
			end
			
			if ((enemy) and (goat2 == "1")) then -- Main DPS combo
				Skill2 = {{ name = "Func: CE.NoCode()",	use = (true) }}
			elseif ((enemy) and (goat2 == "2")) then -- Ranged or instant skils combo
				Skill2 = {{ name = "Func: CE.NoCode()",	use = (true) }}
			elseif ((enemy) and (goat2 == "pvp")) then -- PVP combo
				Skill2 = {{ name = "Func: CE.NoCode()",	use = (true) }}
			end
		---------------------
		-- WARLOCK/WARRIOR --
		---------------------
		elseif subClass == "WARRIOR" then
			if (goat2 == "0") then -- Long bufs
				Skill = {{ name = "Func: CE.NoCode()",	use = (true) }}
			elseif goat2 == "3" then -- Burst boss buff's
				Skill = {
					{ name = "Func: CE.Item("..Sigil..")",	use = Sigil_Use and CE.HaveItem(Sigil) and Sigil_Check and CE.ItemCD(Sigil)},	-- Sigil
					{ name = "ItemID: "..CritFood,	use = CritFood_Use and CE.HaveItem(CritFood) and CritFood_Check and CE.ItemCD(CritFood)},	-- Critical hit food
					{ name = "ItemID: "..SpeedPot,	use = SpeedPot_Use and CE.HaveItem(SpeedPot) and SpeedPot_Check and CE.ItemCD(SpeedPot)},	-- Cast or Attack speed pot
					{ name = "ItemID: "..CritPot,	use = CritPot_Use and CE.HaveItem(CritPot) and CritPot_Check and CE.ItemCD(CritPot) },		-- Critical hit pot
						}
			elseif goat2 == "4" then -- Food and potions
				Skill = {
					{ name = "ItemID: "..HpDef,			use = HpDef_Use and CE.HaveItem(HpDef) and HpDef_Check and CE.ItemCD(HpDef) },			-- Hp or Defense food
					{ name = "ItemID: "..DmgFood, 		use = DmgFood_Use and CE.HaveItem(DmgFood) and DmgFood_Check and CE.ItemCD(DmgFood) },	-- Attack or damage food
					{ name = "ItemID: 200277",			use = Hero_Use and CE.HaveItem(200277) and Hero and CE.ItemCD(200277) },		-- Hero potion
					{ name = "ItemID: 202242",			use = Realgar_Use and CE.HaveItem(202242) and Realgar and CE.ItemCD(202242) },	-- Aged Realgar Wine
					{ name = "Func: CE.ISFood()",		use = ISFood_Use and CE.HaveItem(ISFood) and ISFood_Check and CE.ItemCD(ISFood) },	-- ItemShop Hp/Def Food
						}
			end
			
			if ((enemy) and (goat2 == "1")) then -- Main DPS combo
				Skill2 = {{ name = "Func: CE.NoCode()",	use = (true) }}
			elseif ((enemy) and (goat2 == "2")) then -- Ranged or instant skils combo
				Skill2 = {{ name = "Func: CE.NoCode()",	use = (true) }}
			elseif ((enemy) and (goat2 == "pvp")) then -- PVP combo
				Skill2 = {{ name = "Func: CE.NoCode()",	use = (true) }}
			end
		----------------------
		-- WARLOCK/CHAMPION --
		----------------------
		elseif subClass == "PSYRON" then
			if (goat2 == "0") then -- Long bufs
				Skill = {{ name = "Func: CE.NoCode()",	use = (true) }}
			elseif goat2 == "3" then -- Burst boss buff's
				Skill = {
					{ name = "Func: CE.Item("..Sigil..")",	use = Sigil_Use and CE.HaveItem(Sigil) and Sigil_Check and CE.ItemCD(Sigil)},	-- Sigil
					{ name = "ItemID: "..CritFood,	use = CritFood_Use and CE.HaveItem(CritFood) and CritFood_Check and CE.ItemCD(CritFood)},	-- Critical hit food
					{ name = "ItemID: "..SpeedPot,	use = SpeedPot_Use and CE.HaveItem(SpeedPot) and SpeedPot_Check and CE.ItemCD(SpeedPot)},	-- Cast or Attack speed pot
					{ name = "ItemID: "..CritPot,	use = CritPot_Use and CE.HaveItem(CritPot) and CritPot_Check and CE.ItemCD(CritPot) },		-- Critical hit pot
						}
			elseif goat2 == "4" then -- Food and potions
				Skill = {
					{ name = "ItemID: "..HpDef,			use = HpDef_Use and CE.HaveItem(HpDef) and HpDef_Check and CE.ItemCD(HpDef) },			-- Hp or Defense food
					{ name = "ItemID: "..DmgFood, 		use = DmgFood_Use and CE.HaveItem(DmgFood) and DmgFood_Check and CE.ItemCD(DmgFood) },	-- Attack or damage food
					{ name = "ItemID: 200277",			use = Hero_Use and CE.HaveItem(200277) and Hero and CE.ItemCD(200277) },		-- Hero potion
					{ name = "ItemID: 202242",			use = Realgar_Use and CE.HaveItem(202242) and Realgar and CE.ItemCD(202242) },	-- Aged Realgar Wine
					{ name = "Func: CE.ISFood()",		use = ISFood_Use and CE.HaveItem(ISFood) and ISFood_Check and CE.ItemCD(ISFood) },	-- ItemShop Hp/Def Food
						}
			end
			
			if ((enemy) and (goat2 == "1")) then -- instant skilovi
				Skill2 = {
					{ name = "Heart Collection Strike",          	use = (true) },
					{ name = "Electrocution",                       use = (EnergyBar2 >= 20) },
					{ name = "Rune Energy Influx",                  use = (EnergyBar2 >= 30) },
					{ name = "Warp Charge",                      	use = (EnergyBar1 >= 30) },
					{ name = "Soul Trauma",	                        use = (EnergyBar1 >= 25) },
					{ name = "Surge of Malice",          			use = (EnergyBar1 >= 20) },
					     }
			elseif ((enemy) and (goat2 == "2")) then -- Ranged or instant skils combo
				Skill2 = {{ name = "Func: CE.NoCode()",	use = (true) }}
			elseif ((enemy) and (goat2 == "pvp")) then -- PVP combo
				Skill2 = {{ name = "Func: CE.NoCode()",	use = (true) }}
			end
		end
	end
    --End Player Skill Sequences
    if (not MyCombat(Skill, arg1)) then
        MyCombat(Skill2, arg1)
    end
end
